package pzl.com.photowalldemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.GridView;

import pzl.com.photowalldemo.adapter.Adapter;

public class MainActivity extends AppCompatActivity {
    private GridView gv;
    private Adapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        gv = (GridView) findViewById(R.id.gv);
        adapter = new Adapter(this, gv);
        gv.setAdapter(adapter);
        gv.setOnScrollListener(adapter);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        adapter.destroy();
    }

}
